package cn.ztuo.bitrade.entity;

import lombok.Data;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

@Data
public class ContractMergeOrder {

    private List<ContractOrder> orders = new ArrayList<>();
    public ContractMergeOrder(){

    }

    //最后位置添加一个
    public void add(ContractOrder order){
        orders.add(order);
    }


    public ContractOrder get(){
        return orders.get(0);
    }

    public int size(){
        return orders.size();
    }

    public BigDecimal getPrice(){
        return orders.get(0).getPrice();
    }

    public Iterator<ContractOrder> iterator(){
        return orders.iterator();
    }
}
